//
// Buttons
// --------------------------------------------------


// Base styles
// --------------------------------------------------

.btn {
  font-weight: bold;
  cursor: default;
  background-clip: border-box;
  .button-size(@padding-base-vertical; (@padding-base-horizontal + 4); @font-size-base; @line-height-computed; @btn-border-radius-base);
  .box-shadow(none);

  &:hover {
    .box-shadow(0 1px 1px rgba(0,0,0,0.1));
  }

  &:active,
  &.active {
    .box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.1));
  }
}


// Alternate buttons
// --------------------------------------------------

.btn-default {
  .button-variant(#f5f5f5; #f1f1f1; @btn-default-color; @btn-default-border);
  background-color: @btn-default-bg;
  text-shadow: 0 1px 0 #fff;

  &:hover {
    text-shadow: none;
    border-color: #c6c6c6;
    #gradient > .vertical(@start-color: #f8f8f8; @end-color: #f1f1f1);
    background-position: 0 0;
    .box-shadow(0 1px 1px rgba(0,0,0,0.1));
    .transition(none);
  }

  &:active,
  &.active,
  .open .dropdown-toggle& {
    border: 1px solid @btn-default-border;
    #gradient > .vertical(@start-color: #f6f6f6; @end-color: #f1f1f1);
    background-color: #e8e8e8;
    text-shadow: 0 1px 0 #fff;
    .box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.1));
  }

  &:focus,
  &.focus {
    /* Blue border on button focus. */
    border-color: @brand-primary;
    outline-style: none;
    background-color: @btn-default-bg;
  }

  // Disabled state
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &:hover,
    &:focus,
    &.focus,
    &:active {
      background-color: @btn-default-bg;
      text-shadow: none;
    }
  }

  .badge {
    color: @btn-default-bg;
    text-shadow: none;
  }
}
.btn-primary {
  .button-variant(@brand-primary; #4787ed; @btn-primary-color; @btn-primary-border);
}
// Success appears as green
.btn-success {
  .button-variant(@brand-success; @brand-success; @btn-success-color; @btn-success-border);
}
// Info appears as blue-green
.btn-info {
  .button-variant(@btn-info-bg; @btn-info-bg; @btn-info-color; @btn-info-border);
}
// Warning appears as orange
.btn-warning {
  .button-variant(lighten(@brand-warning, 5%); @brand-warning; @btn-warning-color; @btn-warning-border);
}
// Danger and error appear as red
.btn-danger {
  .button-variant(#dd4b39; #d14836; @btn-danger-color; @btn-danger-border);
}


// Link buttons
// -------------------------

// Make a button look and behave like a link
.btn-link {
  color: @link-color;

  &,
  &:active,
  &.active,
  &[disabled],
  fieldset[disabled] & {
    background-color: transparent;
    .box-shadow(none);
  }
  &,
  &:hover,
  &:focus,
  &.focus,
  &:active {
    border-color: transparent;
  }
  &:hover,
  &:focus,
  &.focus {
    color: @link-hover-color;
    background-color: transparent;
    .box-shadow(none);
  }
  &[disabled],
  fieldset[disabled] & {
    &:hover,
    &:focus
    &.focus {
      color: @btn-link-disabled-color;
    }
  }
}


// Button Sizes
// --------------------------------------------------

.btn-lg {
  // line-height: ensure even-numbered height of button next to large input
  .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-base);
}
.btn-sm {
  // line-height: ensure proper height of button next to small input
  .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-base);
}
.btn-xs {
  .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-mini; @line-height-xs; @btn-border-radius-small);
}
